home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / PictUtil.p < prev    next >
Encoding:
Text File  |  1991-04-03  |  5.1 KB  |  183 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {
  4.     File:        PictUtil.p
  5.  
  6.     Contains:    The pascal interface file for the picture utilities package.
  7.  
  8.     Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  9.  
  10. }
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17.  
  18.     UNIT PictUtil;
  19.     INTERFACE USES    Types,Quickdraw,Palettes;
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. {----------------------------------------------------------------------------------------------------------}
  41.  
  42. CONST
  43.  
  44. {verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls}
  45.  
  46. returnColorTable        =  1;
  47. returnPalette            =  2;
  48. recordComments            =  4;
  49. recordFontInfo            =  8;
  50. suppressBlackAndWhite    = 16;
  51.  
  52.  
  53. {color pick methods}
  54.  
  55. systemMethod            = 0;    {system color pick method}
  56. popularMethod            = 1;    {method that chooses the most popular set of colors}
  57. medianMethod            = 2;    {method that chooses a good average mix of colors}
  58.  
  59.  
  60. {color bank types}
  61.  
  62. ColorBankIsCustom        = -1;
  63. ColorBankIsExactAnd555    =  0;
  64. ColorBankIs555            =  1;
  65.  
  66.  
  67. {----------------------------------------------------------------------------------------------------------}
  68.  
  69. TYPE
  70.  
  71.  
  72. PictInfoID = LONGINT;
  73.  
  74.  
  75. CommentSpecHandle = ^CommentSpecPtr;
  76. CommentSpecPtr = ^CommentSpec;
  77. CommentSpec = RECORD
  78.     count:                INTEGER;                    {number of occurrances of this comment ID}
  79.     ID:                    INTEGER;                     {ID for the comment in the picture}
  80. END;
  81.  
  82.  
  83. FontSpecHandle = ^FontSpecPtr;
  84. FontSpecPtr = ^FontSpec;
  85. FontSpec = RECORD
  86.     pictFontID:            INTEGER;                    {ID of the font in the picture}
  87.     sysFontID:            INTEGER;                     {ID of the same font in the current system file}
  88.     size:                ARRAY [0..3] OF LONGINT;    {bit array of all the sizes found (1..127) (bit 0 means > 127)}
  89.     style:                INTEGER;                     {combined style of all occurrances of the font}
  90.     nameOffset:            LONGINT;                     {offset into the fontNamesHdl handle for the font’s name}
  91. END;
  92.  
  93.  
  94. PictInfoHandle = ^PictInfoPtr;
  95. PictInfoPtr = ^PictInfo;
  96. PictInfo = RECORD
  97.     version:            INTEGER;                    {this is always zero, for now}
  98.     uniqueColors:        LONGINT;                    {the number of actual colors in the picture(s)/pixmap(s)}
  99.     thePalette:            PaletteHandle;                {handle to the palette information}
  100.     theColorTable:        CTabHandle;                    {handle to the color table}
  101.     hRes:                Fixed;                        {maximum horizontal resolution for all the pixmaps}
  102.     vRes:                Fixed;                        {maximum vertical resolution for all the pixmaps}
  103.     depth:                INTEGER;                    {maximum depth for all the pixmaps (in the picture)}
  104.     sourceRect:            Rect;                        {the picture frame rectangle (this contains the entire picture)}
  105.     textCount:            LONGINT;                    {total number of text strings in the picture}
  106.     lineCount:            LONGINT;                    {total number of lines in the picture}
  107.     rectCount:            LONGINT;                    {total number of rectangles in the picture}
  108.     rRectCount:            LONGINT;                    {total number of round rectangles in the picture}
  109.     ovalCount:            LONGINT;                    {total number of ovals in the picture}
  110.     arcCount:            LONGINT;                    {total number of arcs in the picture}
  111.     polyCount:            LONGINT;                    {total number of polygons in the picture}
  112.     regionCount:        LONGINT;                    {total number of regions in the picture}
  113.     bitMapCount:        LONGINT;                    {total number of bitmaps in the picture}
  114.     pixMapCount:        LONGINT;                    {total number of pixmaps in the picture}
  115.     commentCount:        LONGINT;                    {total number of comments in the picture}
  116.     uniqueComments:        LONGINT;                    {the number of unique comments in the picture}
  117.     commentHandle:        CommentSpecHandle;            {handle to all the comment information}
  118.     uniqueFonts:        LONGINT;                    {the number of unique fonts in the picture}
  119.     fontHandle:            FontSpecHandle;                {handle to the FontSpec information}
  120.     fontNamesHandle:    Handle;                        {handle to the font names}
  121.     reserved1:            LONGINT;
  122.     reserved2:            LONGINT;
  123. END;
  124.  
  125.  
  126. {----------------------------------------------------------------------------------------------------------}
  127.  
  128.  
  129. FUNCTION GetPictInfo        (    thePictHandle:        PicHandle;
  130.                             VAR thePictInfo:        PictInfo;
  131.                                 verb:                 INTEGER;
  132.                                 colorsRequested:    INTEGER;
  133.                                 colorPickMethod:    INTEGER;
  134.                                 version:             INTEGER
  135.                             ): OSErr;    INLINE $303C,$0800,$A831;
  136.  
  137.  
  138. FUNCTION GetPixMapInfo        (    thePixMapHandle:    PixMapHandle;
  139.                             VAR    thePictInfo:        PictInfo;
  140.                                 verb:                INTEGER;
  141.                                 colorsRequested:    INTEGER;
  142.                                 colorPickMethod:    INTEGER;
  143.                                 version:            INTEGER
  144.                             ): OSErr;    INLINE $303C,$0801,$A831;
  145.  
  146.  
  147. FUNCTION NewPictInfo        (VAR thePictInfoID:        PictInfoID;
  148.                                 verb:                INTEGER;
  149.                                 colorsRequested:    INTEGER;
  150.                                 colorPickMethod:    INTEGER;
  151.                                 version:            INTEGER
  152.                             ): OSErr;    INLINE $303C,$0602,$A831;
  153.  
  154.  
  155. FUNCTION RecordPictInfo        (    thePictInfoID:        PictInfoID;
  156.                                 thePictHandle:        PicHandle
  157.                             ): OSErr;    INLINE $303C,$0403,$A831;
  158.  
  159.  
  160. FUNCTION RecordPixMapInfo    (    thePictInfoID:        PictInfoID;
  161.                                 thePixMapHandle:    PixMapHandle
  162.                             ): OSErr;    INLINE $303C,$0404,$A831;
  163.  
  164.  
  165. FUNCTION RetrievePictInfo    (    thePictInfoID:        PictInfoID;
  166.                             VAR    thePictInfo:        PictInfo;
  167.                                 colorsRequested:    INTEGER
  168.                             ): OSErr;    INLINE $303C,$0505,$A831;
  169.  
  170.  
  171. FUNCTION DisposPictInfo        (    thePictInfoID:        PictInfoID
  172.                             ): OSErr;    INLINE $303C,$0206,$A831;
  173.  
  174.  
  175. {----------------------------------------------------------------------------------------------------------}
  176.  
  177.     { UsingPictUtil }
  178.  
  179.  
  180.     IMPLEMENTATION
  181. END.
  182.  
  183.